﻿@inject IMessageService _message

<Button Type="ButtonType.Primary" OnClick="OnClick">
    Display normal message
</Button>

@code{
    private async Task OnClick()
    {
        string key = $"updatable-{DateTime.Now.Ticks}";
        var config = new MessageConfig()
        {
            Content = "Loading...",
            Key = key
        };
        _message.Loading(config);

        await Task.Delay(2000);

        config.Content = "Loaded";
        config.Duration = 2;
        _message.Success(config);
    }
}